package com.atguigu.Spring5.service;

import com.atguigu.Spring5.dao.ChengWeiYiDao;
import com.atguigu.Spring5.dao.ChengWeiYiDaoImpl;
import com.atguigu.Spring5.pojo.Ld;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author xiao hu die
 * @Date 2022/4/1 15:04
 * @Version 1.0
 */
@Service
@Transactional
public class ChengWeiYiService {
 @Autowired
 private ChengWeiYiDao chengWeiYiDao;
 public void Insert(Ld ld){
  Integer update = chengWeiYiDao.Update(ld);
  System.out.println(update);
 }
 public void Update(Ld ld){
  Integer update = chengWeiYiDao.Update(ld);
  System.out.println(update);
 }
 public void Delete(Integer integer){
  Integer delete = chengWeiYiDao.Delete(integer);
  System.out.println(delete);
 }
 public void FindOne(Integer integer){
  Ld one = chengWeiYiDao.findOne(integer);
  System.out.println(one.getName());
 }
 public void FindAll(){
  List<Ld> all = chengWeiYiDao.findAll();
  for (Ld ld : all) {
   System.out.println(ld);
  }
 }
 public void zhuanZhang(){
  chengWeiYiDao.jianshao();
 // int a =10/0;
  chengWeiYiDao.tianjia();
 }
}
